﻿/*
Copyright (C) 2009  Tomasz Chrzanowski

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>
*/

using System;

namespace Com.TomCdc.ChangeDataCapture
{
    /// <summary>
    /// Represents source record of tracked table.
    /// </summary>
    class SourceRecord
    {
        /// <summary>
        /// Represents the source record ID.
        /// </summary>
        private readonly Int64 _sourceRowId;

        /// <summary>
        /// Gets the source record ID.
        /// </summary>
        public Int64 SourceRowId
        {
            get { return _sourceRowId; }
        }

        /// <summary>
        /// Represents the source table name.
        /// </summary>
        private readonly string _sourceTableName;
        
        /// <summary>
        /// Gets the source table name.
        /// </summary>
        public string SourceTableName
        {
            get { return _sourceTableName; }
        }

        /// <summary>
        /// Initializes a new instance of <see cref="SourceRecord"/> class with the name of source table and 
        /// source record ID.
        /// </summary>
        /// <param name="sourceTableName">A name of source table.</param>
        /// <param name="sourceRowId">An ID of source record.</param>
        public SourceRecord(string sourceTableName, Int64 sourceRowId)
        {
            _sourceRowId = sourceRowId;
            _sourceTableName = sourceTableName;
        }
    }
}
